﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLPropertyGrid
{
    public class IntBindingSynch : INotifyPropertyChanged
    {
        public IntBindingSynch()
        {
            Debug.WriteLine("Create");
        }
        private GridLength _value;

        public GridLength Value
        {
            get { return _value; }
            set
            {
                GridLength _oldValue = _value;
                _value = value;
                if (!_value.Equals(_oldValue))
                    OnPropertyChanged("Value");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

}
